import { action, observable } from 'mobx'
import expressService from '../services/express/expressService';
import { ExpressDto } from '../services/express/dto/expressDto';

class ExpressStore {
    @observable addressList: string
    @observable express: ExpressDto

    @action
    async getOrderTracesByJson(code: string, logistic: string) {
        await expressService.getOrderTracesByJson(code, logistic).then((res) => {
            this.addressList = res.data.result
        })
    }

    @action
    async getExpressByCode(code: string) {
        await expressService.getExpressByCode(code).then((res) => {
            this.express = res.data.result
        })
    }
}

export default ExpressStore 